home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / edit / me_cd25.zip / MUTT2.ZIP / UNDO.MUT < prev    next >
Text File  |  1992-11-09  |  838b  |  41 lines

  1.   ;; C Durland    Public Domain
  2.  
  3. (include me2.h)
  4.  
  5. (defun
  6.   turn-on-undo
  7.   {
  8.     (buffer-flags -1 (bit-or (buffer-flags -1) BFUndo))
  9.   }
  10.   iturn-on-undo
  11.   {
  12.     (turn-on-undo)
  13.     (msg "Undo turned on for " (buffer-name -1))
  14.   }
  15.   turn-off-undo
  16.   {
  17.     (buffer-flags -1 (bit-and (buffer-flags -1) (bit-xor -1 BFUndo)))
  18.     (msg "Undo turned off for " (buffer-name -1))
  19.   }
  20.   undo
  21.   {
  22.     (switch (do-undo)
  23.       0 
  24.       {
  25.     (if (== 0 (bit-and (buffer-flags -1) BFUndo))
  26.       (msg "Undo is turned off - nothing to undo!")
  27.       (msg "All undoed - undo list empty."))
  28.       }
  29.       1 (msg "Undoed")
  30.       2 (msg "Undo problems.")
  31.     )
  32.   }
  33.   MAIN
  34.   {
  35.     (bind-to-key "undo" 'C-_')        ;; GNU binding
  36.     (bind-to-key "undo" "C-xu")        ;; GNU binding
  37.  
  38.     (register-hook IBUFFER-CREATED-HOOK "turn-on-undo")
  39.   }
  40. )
  41.